<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
	<meta charset="UTF-8">
	<link rel="shortcut icon" href="favicon.ico">
	<link rel="stylesheet" href="css/iconfont.css">
	<link rel="stylesheet" href="css/global.css">
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/bootstrap-theme.min.css">
	<link rel="stylesheet" href="css/swiper.min.css">
	<link rel="stylesheet" href="css/styles.css">
	<script src="js/jquery.1.12.4.min.js" charset="UTF-8"></script>
	<script src="js/bootstrap.min.js" charset="UTF-8"></script>
	<script src="js/swiper.min.js" charset="UTF-8"></script>
	<script src="js/global.js" charset="UTF-8"></script>
	<!-- <script src="js/jquery.DJMask.2.1.1.js" charset="UTF-8"></script> -->
	<title>U袋网</title>
</head>
<body>
<!-- 顶部tab -->
<div class="tab-header">
	<div class="inner">
		<div class="pull-left">
			<div class="pull-left">嗨，欢迎来到<span class="cr">U袋网</span></div>
			<a href="temp_article/udai_article4.jsp">帮助中心</a>
		</div>
		<div class="pull-right">
			<a href="login.jsp"><span class="cr">登录</span></a>
			<a href="login.jsp?p=register">注册</a>
			<a href="udai_welcome.jsp">我的U袋</a>
			<a href="udai_order.jsp">我的订单</a>
		</div>
	</div>
</div>
<!-- 顶部标题 -->
<div class="bgf5 clearfix">
	<div class="top-user">
		<div class="inner">
			<a class="logo" href="index.jsp"><img src="images/icons/logo.jpg" alt="U袋网" class="cover"></a>
			<div class="title">个人中心</div>
		</div>
	</div>
</div>
<div class="content clearfix bgf5">
	<section class="user-center inner clearfix">
		<div class="pull-left bgf">
			<a href="udai_welcome.jsp" class="title">U袋欢迎页</a>
			<dl class="user-center__nav">
				<dt>帐户信息</dt>
				<a href="udai_setting.jsp"><dd>个人资料</dd></a>
				<a href="udai_address.jsp"><dd>收货地址</dd></a>
				<a href="udai_pwd_modify.jsp"><dd>修改登录密码</dd></a>
			</dl>
			<dl class="user-center__nav">
				<dt>订单中心</dt>
				<a href="udai_order.jsp"><dd>我的订单</dd></a>
				<a href="udai_collection.jsp"><dd>我的收藏</dd></a>
				<a href="udai_refund.jsp"><dd>退款/退货</dd></a>
			</dl>
			<dl class="user-center__nav">
				<dt>服务中心</dt>
				<a href="udai_mail_query.jsp"><dd>物流查询</dd></a>
				<a href=""><dd>数据自助下载</dd></a>
				<a href="temp_article/udai_article1.jsp"><dd>售后服务</dd></a>
				<a href="temp_article/udai_article2.jsp"><dd>配送服务</dd></a>
				<a href="temp_article/udai_article3.jsp"><dd>用户协议</dd></a>
				<a href="temp_article/udai_article4.jsp"><dd>常见问题</dd></a>
			</dl>
			<dl class="user-center__nav">
				<dt>新手上路</dt>
				<a href="temp_article/udai_article5.jsp"><dd>如何成为代理商</dd></a>
				<a href="temp_article/udai_article6.jsp"><dd>代销商上架教程</dd></a>
				<a href="temp_article/udai_article7.jsp"><dd>分销商常见问题</dd></a>
				<a href="temp_article/udai_article8.jsp"><dd>付款账户</dd></a>
			</dl>
			<dl class="user-center__nav">
				<dt>U袋网</dt>
				<a href="temp_article/udai_article10.jsp"><dd>企业简介</dd></a>
				<a href="temp_article/udai_article11.jsp"><dd>加入U袋</dd></a>
				<a href="temp_article/udai_article12.jsp"><dd>隐私说明</dd></a>
			</dl>
		</div>
		<div class="pull-right">
			<div class="user-content__box clearfix bgf">
				<div class="title">账户信息-收货地址</div>
				<form action="RequestServlet?action=showUserAddAction&op=new" method="post" class="user-addr__form form-horizontal" role="form">
					<p class="fz18 cr">新增收货地址<span class="c6" style="margin-left: 20px">地址详情选填一项，其余均为必填项</span></p>
					<div class="form-group">
						<label for="name" class="col-sm-2 control-label">收货人姓名：</label>
						<div class="col-sm-6">
							<input class="form-control" name="user_name" id="name" placeholder="请输入姓名" type="text">
						</div>
					</div>
					<div class="form-group">
						<label for="details" class="col-sm-2 control-label">收货地址：</label>
						<div class="col-sm-10">
							<input name="users_add" class="form-control" id="details1" placeholder="联系地址" maxlength="30" type="text">
							<input name="users_add_info" class="form-control" id="details" placeholder="详细收货地址，例如街道名称，门牌号码等信息" maxlength="30" type="text">
						</div>
					</div>
					<!-- <div class="form-group">
                        <label for="code" class="col-sm-2 control-label">地区编码：</label>
                        <div class="col-sm-6">
                            <input class="form-control" id="code" placeholder="请输入邮政编码" type="text">
                        </div>
                    </div> -->
					<div class="form-group">
						<label for="mobile" class="col-sm-2 control-label">手机号码：</label>
						<div class="col-sm-6">
							<input name="users_phone" class="form-control" id="mobile" placeholder="请输入手机号码" type="text">
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-6">
							<div class="checkbox">
								<label><input name="checkbox" type="checkbox"><i></i> 设为默认收货地址</label>
							</div>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-6">
							<button type="submit" class="but">保存</button>
						</div>
					</div>
					<script type="text/javascript" src="js/jquery.citys.js"></script>
					<script type="text/javascript" src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"></script>
					<script type="text/javascript">
                        $(document).ready(function(){
                            $.ajax({
                                "url":"ResponseServlet",
                                "type":"post",
                                "data":"op=show&action=showUserAddAction",
                                "dataType": "json",
                                "success": function (result) {
                                    $.each(result,function (i,val) {
                                       $(".addr-list").append(
										   "<div class=\"addr-item\">\n" +
                                           "\t\t\t\t\t\t\t<div class=\"tdf1\">"+val.users_name+"</div>\n" +
                                           "\t\t\t\t\t\t\t<div class=\"tdf2 tdt-a_l\">"+val.users_add+"</div>\n" +
                                           "\t\t\t\t\t\t\t<div class=\"tdf3 tdt-a_l\">"+val.users_add_info+"</div>\n" +
                                           "\t\t\t\t\t\t\t<!-- <div class=\"tdf1\">350111</div> -->\n" +
                                           "\t\t\t\t\t\t\t<div class=\"tdf1\">"+val.users_phone+"</div>\n" +
                                           "\t\t\t\t\t\t\t<div class=\"tdf1 order\">\n" +
                                           "\t\t\t\t\t\t\t\t<a href=\"RequestServlet?action=showUserAddAction&op=edit&add_id="+val.add_id+"\">修改</a><a href=\"RequestServlet?action=showUserAddAction&op=del&add_id="+val.add_id+"\">删除</a>\n" +
                                           "\t\t\t\t\t\t\t</div>\n" +
                                           "\t\t\t\t\t\t\t<div class=\"tdf1\">\n" +
                                           "\t\t\t\t\t\t\t\t<a href=\"RequestServlet?action=showUserAddAction&op=set&add_id="+val.add_id+"\" class=\""+(val.state==0?"default active":"default")+"\">默认地址</a>\n" +
                                           "\t\t\t\t\t\t\t</div>\n" +
                                           "\t\t\t\t\t\t</div>");
                                    });
                                }
                            });
                            // 添加街道/乡镇
                            function townFormat(info){
                                $('.addr-linkage select[name="town"]').hide().empty();
                                if (info['code'] % 1e4 && info['code'] < 7e6){	//是否为“区”且不是港澳台地区
                                    var ajaxConfig = {
                                        url: 'http://passer-by.com/data_location/town/' + info['code'] + '.json',
                                        scriptCharset:'UTF-8',
                                        dataType: "json",
                                        timeout: 4000,
                                        success: function(data) {
                                            $('.addr-linkage select[name="town"]').show();
                                            // $('#code').val(info['code']) // 填地区编码
                                            for (i in data) {
                                                $('.addr-linkage select[name="town"]').append(
                                                    '<option value="' + data[i] + '">' + data[i] + '</option>'
                                                );
                                            }
                                        },
                                    };
                                    $.ajax(ajaxConfig).fail(function(p1,p2,p3){
                                        ajaxConfig.url = 'js/data_location/town/' + info['code'] + '.json';
                                        $.ajax(ajaxConfig)
                                    });
                                }
                            };
                            $('.addr-linkage').citys({
                                // 如果某天这个仓库地址失效了dataUrl请使用本地 2017.10 的数据 'js/data_location/list.json'
                                dataUrl: 'http://passer-by.com/data_location/list.json',
                                spareUrl: 'js/data_location/list.json',
                                dataType: 'json',
                                valueType: 'name',
                                province: remote_ip_info['province'],
                                city: remote_ip_info['city'],
                                area: remote_ip_info['district'],
                                onChange: function(data) {
                                    townFormat(data)
                                },
                            },function(api){
                                var info = api.getInfo();
                                townFormat(info);
                            });
                        });
					</script>
				</form>
				<p class="fz18 cr">已保存的有效地址</p>

				<div class="table-thead addr-thead">
					<div class="tdf1">收货人</div>
					<div class="tdf2">所在地</div>
					<div class="tdf3"><div class="tdt-a_l">详细地址</div></div>
					<!-- <div class="tdf1">邮编</div> -->
					<div class="tdf1">电话/手机</div>
					<div class="tdf1">操作</div>
					<div class="tdf1"></div>
				</div>
				<div  class="addr-list">
				</div>
			</div>
		</div>
	</section>
</div>
<!-- 右侧菜单 -->
<div class="right-nav">
	<ul class="r-with-gotop">
		<li class="r-toolbar-item">
			<a href="udai_welcome.jsp" class="r-item-hd">
				<i class="iconfont icon-user" data-badge="0"></i>
				<div class="r-tip__box"><span class="r-tip-text">用户中心</span></div>
			</a>
		</li>
		<li class="r-toolbar-item">
			<a href="udai_shopcart.jsp" class="r-item-hd">
				<i class="iconfont icon-cart"></i>
				<div class="r-tip__box"><span class="r-tip-text">购物车</span></div>
			</a>
		</li>
		<li class="r-toolbar-item">
			<a href="udai_collection.jsp" class="r-item-hd">
				<i class="iconfont icon-aixin"></i>
				<div class="r-tip__box"><span class="r-tip-text">我的收藏</span></div>
			</a>
		</li>
		<li class="r-toolbar-item">
			<a href="" class="r-item-hd">
				<i class="iconfont icon-liaotian"></i>
				<div class="r-tip__box"><span class="r-tip-text">联系客服</span></div>
			</a>
		</li>
		<li class="r-toolbar-item">
			<a href="issues.jsp" class="r-item-hd">
				<i class="iconfont icon-liuyan"></i>
				<div class="r-tip__box"><span class="r-tip-text">留言反馈</span></div>
			</a>
		</li>
		<li class="r-toolbar-item to-top">
			<i class="iconfont icon-top"></i>
			<div class="r-tip__box"><span class="r-tip-text">返回顶部</span></div>
		</li>
	</ul>
	<script>
        $(document).ready(function(){ $('.to-top').toTop({position:false}) });
	</script>
</div>
<!-- 底部信息 -->
<div class="footer">
	<div class="footer-tags">
		<div class="tags-box inner">
			<div class="tag-div">
				<img src="images/icons/footer_1.gif" alt="厂家直供">
			</div>
			<div class="tag-div">
				<img src="images/icons/footer_2.gif" alt="一件代发">
			</div>
			<div class="tag-div">
				<img src="images/icons/footer_3.gif" alt="美工活动支持">
			</div>
			<div class="tag-div">
				<img src="images/icons/footer_4.gif" alt="信誉认证">
			</div>
		</div>
	</div>
	<div class="footer-links inner">
		<dl>
			<dt>U袋网</dt>
			<a href="temp_article/udai_article10.jsp"><dd>企业简介</dd></a>
			<a href="temp_article/udai_article11.jsp"><dd>加入U袋</dd></a>
			<a href="temp_article/udai_article12.jsp"><dd>隐私说明</dd></a>
		</dl>
		<dl>
			<dt>服务中心</dt>
			<a href="temp_article/udai_article1.jsp"><dd>售后服务</dd></a>
			<a href="temp_article/udai_article2.jsp"><dd>配送服务</dd></a>
			<a href="temp_article/udai_article3.jsp"><dd>用户协议</dd></a>
			<a href="temp_article/udai_article4.jsp"><dd>常见问题</dd></a>
		</dl>
		<dl>
			<dt>新手上路</dt>
			<a href="temp_article/udai_article5.jsp"><dd>如何成为代理商</dd></a>
			<a href="temp_article/udai_article6.jsp"><dd>代销商上架教程</dd></a>
			<a href="temp_article/udai_article7.jsp"><dd>分销商常见问题</dd></a>
			<a href="temp_article/udai_article8.jsp"><dd>付款账户</dd></a>
		</dl>
	</div>
	<div class="copy-box clearfix">
		<ul class="copy-links">
			<a href="agent_level.jsp"><li>网店代销</li></a>
			<a href="class_room.jsp"><li>U袋学堂</li></a>
			<a href="udai_about.jsp"><li>联系我们</li></a>
			<a href="temp_article/udai_article10.jsp"><li>企业简介</li></a>
			<a href="temp_article/udai_article5.jsp"><li>新手上路</li></a>
		</ul>
		<!-- 版权 -->
		<p class="copyright">
			© 2005-2017 U袋网 版权所有，并保留所有权利<br>
			ICP备案证书号：闽ICP备16015525号-2&nbsp;&nbsp;&nbsp;&nbsp;福建省宁德市福鼎市南下村小区（锦昌阁）1栋1梯602室&nbsp;&nbsp;&nbsp;&nbsp;Tel: 18650406668&nbsp;&nbsp;&nbsp;&nbsp;E-mail: 18650406668@qq.com
		</p>
	</div>
</div>
</body>
</html>
